package org.scub.foundation.fournisseur.egicom.core.dto;

import net.sf.oval.constraint.NotBlank;
import net.sf.oval.constraint.NotNull;

import org.scub.foundation.framework.base.dto.AbstractDto;
import org.scub.foundation.framework.base.dto.IdLabelDto;
import org.scub.foundation.framework.base.dto.value.PhoneAsValueDto;

/**
 * Dto pour le transport de téléphones.
 * @author Adrien HAUTOT (adrien.hautot@scub.net)
 */
public class TelephoneDto extends AbstractDto {
    private static final long serialVersionUID = 3358697598307958196L;

    @NotNull.List(value = {
        @NotNull,
        @NotNull(target = "id")
        })
    private IdLabelDto type;

    @NotNull.List(value = {
        @NotNull,
        @NotNull(target = "numero"),
        @NotNull(target = "format"),
        @NotNull(target = "indicatif"),
        @NotNull(target = "tag")
    })
    @NotBlank.List(value = {
        @NotBlank,
        @NotBlank(target = "numero"),
        @NotBlank(target = "indicatif"),
        @NotBlank(target = "tag")
    })
    private PhoneAsValueDto value;

    /**
     * Créé un téléphone.
     */
    public TelephoneDto() {
    }

    /**
     * Créé un téléphone.
     * @param type le type
     * @param value la valeur du téléphone
     */
    public TelephoneDto(IdLabelDto type, PhoneAsValueDto value) {
        this.type = type;
        this.value = value;
    }

    /**
     * Get the value of type.
     * @return the type
     */
    public IdLabelDto getType() {
        return type;
    }

    /**
     * Set the value of type.
     * @param type the type to set
     */
    public void setType(IdLabelDto type) {
        this.type = type;
    }

    /**
     * Get the value of value.
     * @return the value
     */
    public PhoneAsValueDto getValue() {
        return value;
    }

    /**
     * Set the value of value.
     * @param value the value to set
     */
    public void setValue(PhoneAsValueDto value) {
        this.value = value;
    }

}
